package org.lex.ftp.model;

import javax.swing.Icon;

import org.lex.net.ftp.IFTPFile;
import org.lex.swing.ColorIcon;
import org.lex.swing.Swings;

public class SimpleFTPFileView implements FTPFileView {
	private static final Icon EMPTY = new ColorIcon(0, 0);
	private static final Icon FILE = Swings.fileIcon();
	private static final Icon FOLDER = Swings.directoryIcon();

	public Icon getIcon(IFTPFile file) {
		if (null == file)
			return EMPTY;
		if (file.isDirectory())
			return FOLDER;
		else
			return FILE;
	}
}
